from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from health import models

from health import healthser


# Create your views here.

class HealthListView(APIView):
    def get(self, request):
        health_list = models.Health.objects.filter(parent__isnull=True)
        ser = healthser.HealthSerializer(health_list, many=True)
        return Response({"msg": "ok", "data": ser.data})
